﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true"
    CodeBehind="Bill.aspx.cs" Inherits="MyWeb.Admins.Bill" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="PageName">
        Hóa Đơn</div>
    <asp:Panel ID="pnView" runat="server">
        <div class="Control">
            <ul>
                <asp:LinkButton CssClass="vdelete" ID="lbtDeleteT" runat="server" OnClick="lbtDeleteT_Click">Xóa</asp:LinkButton></li>
                <li>
                    <asp:LinkButton CssClass="vrefresh" ID="lbtRefreshT" runat="server" OnClick="RefreshButton_Click">Làm mới</asp:LinkButton></li>
            </ul>
        </div>
        <asp:DataGrid ID="grdBill" runat="server" Width="100%" CssClass="TableView" AutoGenerateColumns="False"
            AllowPaging="True" PageSize="20" PagerStyle-Mode="NumericPages" PagerStyle-HorizontalAlign="Center"
            OnItemDataBound="grdBill_ItemDataBound" OnItemCommand="grdBill_ItemCommand" OnPageIndexChanged="grdBill_PageIndexChanged">
            <HeaderStyle CssClass="trHeader"></HeaderStyle>
            <ItemStyle CssClass="trOdd"></ItemStyle>
            <AlternatingItemStyle CssClass="trEven"></AlternatingItemStyle>
            <Columns>
                <asp:TemplateColumn ItemStyle-CssClass="tdCenter">
                    <HeaderTemplate>
                        <asp:CheckBox ID="chkSelectAll" runat="server" AutoPostBack="False"></asp:CheckBox>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSelect" runat="server"></asp:CheckBox>
                    </ItemTemplate>
                    <ItemStyle CssClass="tdCenter"></ItemStyle>
                </asp:TemplateColumn>
                <asp:BoundColumn DataField="Id" HeaderText="Id" />
                <asp:BoundColumn DataField="Active" HeaderText="Active" Visible="False" />
                <asp:BoundColumn DataField="Name" HeaderText="Tên" ItemStyle-CssClass="Text" Visible="true" />
                <asp:BoundColumn DataField="Totalmoney" HeaderText="Tổng Tiền" ItemStyle-CssClass="MoneyUSD"
                    Visible="true" />
                <asp:TemplateColumn ItemStyle-CssClass="DateTime">
                    <HeaderTemplate>
                        Ngày đăng</HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# MyWeb.Common.DateTimeClass.ConvertDateTime(DataBinder.Eval(Container.DataItem, "Datesend").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn ItemStyle-CssClass="DateTime">
                    <HeaderTemplate>
                        Ngày đăng</HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# MyWeb.Common.DateTimeClass.ConvertDateTime(DataBinder.Eval(Container.DataItem, "DateReceive").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn ItemStyle-CssClass="Active">
                    <HeaderTemplate>
                        Giao Hàng</HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lblStatus" runat="server" Text='<%# MyWeb.Common.PageHelper.ShowGiaoHang(Eval("Active").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn ItemStyle-CssClass="Function">
                    <HeaderTemplate>
                        Chức năng</HeaderTemplate>
                    <ItemTemplate>
                        <asp:ImageButton ID="cmdEdit" runat="server" AlternateText="Sửa" CommandName="Edit"
                            CssClass="Edit" ToolTip="Sửa" ImageUrl="/App_Themes/Admin/images/edit.png" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id")%>' /><asp:ImageButton
                                ID="cmdDelete" runat="server" AlternateText="Xóa" CommandName="Delete" CssClass="Delete"
                                ToolTip="Xóa" ImageUrl="/App_Themes/Admin/images/delete.png" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id")%>'
                                OnClientClick="javascript:return confirm('Bạn có muốn xóa?');" /><asp:ImageButton
                                    ID="cmdActive" runat="server" AlternateText='<%#MyWeb.Common.PageHelper.ShowActiveToolTip(DataBinder.Eval(Container.DataItem, "Active").ToString())%>'
                                    CommandName="Active" CssClass="Active" ToolTip='<%# MyWeb.Common.PageHelper.ShowGiaoHang(DataBinder.Eval(Container.DataItem, "Active").ToString())%>'
                                    ImageUrl='<%#MyWeb.Common.PageHelper.ShowActiveImage(DataBinder.Eval(Container.DataItem, "Active").ToString())%>'
                                    CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id")%>' /></ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
            <PagerStyle HorizontalAlign="Center" CssClass="Paging" Position="Bottom" NextPageText="Previous"
                PrevPageText="Next" Mode="NumericPages"></PagerStyle>
        </asp:DataGrid>
    </asp:Panel>
    <asp:Panel ID="pnUpdate" runat="server" Visible="False">
        <table width="100%">
            <tr>
                <td>
                    <div class="PageName">
                        Thông tin khách hàng<asp:TextBox ID="txtIdCus" runat="server" Visible="False"></asp:TextBox></div>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:DataGrid ID="grdCustormer" runat="server" CssClass="TableView" AutoGenerateColumns="False"
                        ShowHeader="false">
                        <Columns>
                            <asp:TemplateColumn>
                                <ItemTemplate>
                                    <table border="0">
                                        <tr>
                                            <th>
                                                Họ tên:
                                            </th>
                                            <td>
                                                <%#Eval("Name").ToString() %>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>
                                                Địa chỉ
                                            </th>
                                            <td>
                                                <%#Eval("Address").ToString()%>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>
                                                Điện thoại
                                            </th>
                                            <td>
                                                <%#Eval("Phone").ToString()%>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>
                                                Email:
                                            </th>
                                            <td>
                                                <%#Eval("Email").ToString() %>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>
                                                Thanh toán:
                                            </th>
                                            <td>
                                                <%#Eval("Status").ToString() %>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>
                                                Yêu cầu của KH:
                                            </th>
                                            <td>
                                                <%#Eval("Detail").ToString()%>
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                        </Columns>
                    </asp:DataGrid>
                </td>
            </tr>
            <tr>
                <td class="PageName">
                    Thông tin đơn hàng
                </td>
            </tr>
            <tr>
                <td class="style1">
                    <asp:DataGrid ID="grdShopcard" runat="server" AutoGenerateColumns="false" Width="100%"
                        CellPadding="10">
                        <Columns>
                            <asp:TemplateColumn>
                                <HeaderTemplate>
                                    Sản phẩm</HeaderTemplate>
                                <ItemTemplate>
                                    <%#Tensp(Eval("ProductId").ToString())%>
                                    <br />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:TemplateColumn>
                            <asp:TemplateColumn>
                                <HeaderTemplate>
                                    Số lượng</HeaderTemplate>
                                <ItemTemplate>
                                    <%#Eval("Quantity").ToString() %>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateColumn>
                            <asp:TemplateColumn>
                                <HeaderTemplate>
                                    Giá bán</HeaderTemplate>
                                <ItemTemplate>
                                    <%#Format_Frice(Eval("Price").ToString())%>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:TemplateColumn>
                            <asp:TemplateColumn>
                                <HeaderTemplate>
                                    Thành tiền</HeaderTemplate>
                                <ItemTemplate>
                                    <%#Format_Frice(Eval("Total").ToString())%></ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:TemplateColumn>
                        </Columns>
                        <HeaderStyle HorizontalAlign="Center" BackColor="#00CCFF" Font-Bold="True" Font-Overline="False" />
                        <ItemStyle BackColor="#FFCCFF" />
                    </asp:DataGrid>
                    <table width="100%" border="0" cellspacing="0" cellpadding="3" style="background: #E8E8E8;
                        border-collapse: collapse">
                        <tr style="border: 1px solid #FFF; height: 30px">
                            <td align="right" style="border-left: 1px solid #B3B3B3; font-weight: bold">
                                &nbsp;
                            </td>
                            <td style="text-align: right">
                                &nbsp;
                            </td>
                            <td style="border-right: 1px solid #B3B3B3; text-align: right; padding-right: 20px">
                                &nbsp;
                            </td>
                        </tr>
                        <tr style="border: 1px solid #FFF; height: 30px">
                            <td width="57%" align="right" style="border-left: 1px solid #B3B3B3; border-bottom: 1px solid #B3B3B3">
                                <asp:Label ID="lblsum" runat="server" Text="Tổng số tiền" Font-Bold="True"></asp:Label>
                            </td>
                            <td width="3%" style="border-bottom: 1px solid #B3B3B3">
                                &nbsp;
                            </td>
                            <td width="20%" style="border-right: 1px solid #B3B3B3; border-bottom: 1px solid #B3B3B3;
                                padding-right: 20px" align="right">
                                <asp:Label ID="lblsumpay" runat="server" ForeColor="Red"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblActive" runat="server" Text="Đã giao hàng:"></asp:Label><asp:CheckBox
                                    ID="chkActive" runat="server" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td class="Control">
                    <ul>
                        <li>
                            <asp:LinkButton ID="LinkButton1" runat="server" CssClass="uupdate" OnClick="LinkButton1_Click">Ghi Lại</asp:LinkButton>
                        </li>
                        <li>
                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CssClass="uback"
                                OnClick="Back_Click">Trở về</asp:LinkButton>
                        </li>
                    </ul>
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
